<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<import type="css" file="css.workform" />
<title>Insert title here</title>
</head>
<body>

</body>
</html><html>
<head>
<title>多功能日历控件设定</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script>
function my_submit()
{
if(ITEM_NAME.value=="")
{
	 alert("控件名称不能为空");
	 return;
}
if(edit_flag==0)
{
	 var parent_window = parent.dialogArguments;
	 //var control_html="<img src=\\"calendar.gif\\" class=\\"DATE\\" align=absmiddle border=0 style=\\"cursor:hand\\" value=\\""+ITEM_NAME.value.replace("\\"","&quot;")+"\\" title=\\"日期控件："+ITEM_NAME.value.replace("\\"","&quot;")+"\\">";
	 //var control_html="<input type=\"text\" class=\"Wdate\" align=absmiddle border=0 style=\"cursor:hand\" onclick=\"WdatePicker()\" title=\""+ITEM_NAME.value+"\" name=\"data_\" >";
	 var control_html = "从<input id=\"start\" class=\"Wdate\" type=\"text\" onFocus=\"WdatePicker({dateFmt:'yyyy-MM-dd H',maxDate:'#F{$dp.$D(end)}'})\" title=\""+ITEM_NAME.value+"\" name=\"data_\" > 到"+
	                    "<input id=\"end\" class=\"Wdate\" type=\"text\" onFocus=\"WdatePicker({dateFmt:'yyyy-MM-dd H',minDate:'#F{$dp.$D(start)}',maxDate:'2020-10-01'})\" title=\""+ITEM_NAME1.value+"\" name=\"data_\">";
		
	 parent_window.EDIT_HTML.insertHtml(control_html);
}
else
{
	 oSelection = dialogArguments.document.selection.createRange();
	 sRangeType = dialogArguments.document.selection.type;
	 if (sRangeType == "Control") 
	 {
 	oSelection(0).value = ITEM_NAME.value;
 	oSelection(0).title = "日期控件："+ITEM_NAME.value;
	 }
}
window.close();
}
//-- 获取控件属性 --
var edit_flag=0;
function LoadDo()
{
oSelection = dialogArguments.document.selection.createRange();
sRangeType = dialogArguments.document.selection.type;
if (sRangeType == "Control") 
{
	edit_flag=1;
	ITEM_NAME.value = oSelection(0).value;
}
ITEM_NAME.focus();
}
</script>
</head>
<body topmargin="0" onload="LoadDo();">
<table border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3" align="center">
<tr class="TableContent">
		<td nowrap><b>起始控件名称</b>：
		</td>
		<td nowrap>
		 <Input name="ITEM_NAME" type="text" class="SmallInput" size="20">
		</td>
</tr>

<tr class="TableContent">
		<td nowrap><b>结束框控件名称</b>：
		</td>
		<td nowrap>
		 <Input name="ITEM_NAME1" type="text" class="SmallInput" size="20">
		</td>
</tr>

<tr class="TableData">
		<td colspan="2">说明：日历控件选择的日期、时间将回填到该输入框中
		</td>
</tr>
<tr>
		<td class="TableControl" colspan="2" align="center">
			<input type="submit" onclick="my_submit();" value="确 定" class="SmallButton">
		</td>
</tr>
</table>
</body>
</html>